<%
  button_class = local_assigns.fetch :button_class, 'stripe-button-el'
  button_id = local_assigns.fetch :button_id, "cancel-subscription-#{subscription.guid}"
  button_text = local_assigns.fetch :button_text, "Cancel Subscription"
  confirm_text = local_assigns.fetch :confirm_text, "Are you sure?"
  disabled = !subscription.active?
  url = local_assigns.fetch :url, payola.cancel_subscription_path(subscription.guid)
  at_period_end = local_assigns.fetch :at_period_end, false
%>

<%= form_tag url, :method => :delete do %>
  <%= hidden_field_tag :at_period_end, at_period_end %>
  <%= button_tag type: 'submit', class: button_class, disabled: disabled, data: { confirm: confirm_text } do %>
    <%= content_tag(:span, button_text, class: 'payola-subscription-cancel-buton-text') %>
  <% end -%>
<% end -%>
